<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.util.Enumeration"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Cluster Test</title></head>
<body>
<%
	//HttpSession session = request.getSession(true);
	System.out.println(session.getId());
	out.println("<br> SESSION ID:" + session.getId()+"<br>");
	// 如果有新的请求，则添加session属性
	String name = request.getParameter("name");
	if (name != null && name.length() > 0) {
	 String value = request.getParameter("value");
	 session.setAttribute(name, value);
	}
	out.print("<b>Session List:</b>");
	Enumeration<String> names = session.getAttributeNames();
	while (names.hasMoreElements()) {
	String sname = names.nextElement(); 
	String value = session.getAttribute(sname).toString();
	out.println( sname + " = " + value+"<br>");
	System.out.println( sname + " = " + value);
	 }
	%>
	<form action="testCluster.jsp" method="post">
	名称:<input type=text size=20 name="name">
	 <br>
	值:<input type=text size=20 name="value">
 <br>
<input type=submit value="提交">
 </form>
</body>
</html>